<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace app\common\model;

/**
 * Description of FeedBack
 *
 * @author 高磊<1455209597@qq.com>
 */
class FeedBack extends Base{
    	protected $auto = array('update_time');
	protected $insert = array('create_time');
        protected $table='xy_feedback';
	protected $type = array(
		'id'   => 'integer',
		'cover_id'   => 'integer',
	);

	public $keyList = array(
		array('name'=>'id', 'title'=>'ID', 'type'=>'hidden', 'help'=>'', 'option'=>''),
		array('name'=>'username', 'title'=>'用户名', 'type'=>'readonly', 'help'=>'100个字以内', 'option'=>''),
		array('name'=>'content', 'title'=>'反馈内容', 'type'=>'textarea', 'help'=>'', 'option'=>''),
	);
       /**
        * 获取反馈列表
        */
        public static function getFeedBackList($param,$order=''){
           $res= \think\Db::name('feedback f')
                   ->join('user u','f.user_id = u.id')
                   ->where($param)
                   ->order($order)
                   ->field('f.id,u.username,u.nickname,f.create_time,f.content')
                   ->paginate();
           return $res;
        }
}
